home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d3 / wf200_c.arc / WF.011 < prev    next >
Text File  |  1990-08-30  |  6KB  |  153 lines

  1. .f3                              - # -              Chapter 11 - Calculator
  2. .rm70
  3. .mt5
  4. .mb5
  5. .pl66
  6. .tc
  7. .tc 11. CALCULATOR ........................................#
  8. 11. CALCULATOR
  9.  
  10. Word Fugue has a built in calculator that you can use while you are
  11. editing. All the usual mathematical operations are available -
  12. addition, subtraction, division, multiplication, and exponentiation.
  13. Additional functions are natural and common logarithms, square root,
  14. factorial, and the trigometric functions sine, cosine, tangent and
  15. arctangent.
  16.  
  17. Several symbols (operators) are used in Word Fugue's Mathematical
  18. equations.
  19.  
  20.     Operator            Function
  21.      +                  addition
  22.      -                  subtraction
  23.      ^                  exponentiation (raising a number to a power)
  24.      *                  multiplication
  25.      /                  division
  26.      div                integer division
  27.      mod                integer division giving remainder only
  28.      shl                shift the bit pattern (4 byte integer) left
  29.      shr                shift the bit pattern (4 byte integer) right
  30.      and                merge 2 bit patterns so that 1 and 1 -> 1
  31.                         any other combination gives zero
  32.      or                 merge 2 bit patterns so that if either is 1,
  33.                         the result is 1
  34.      xor                merge 2 bit patterns so that if either is 1,
  35.                         the result is one
  36.  
  37.     SQRT()              square root
  38.     SQR()               square
  39.     SIN()               sine
  40.     COS()               cosine
  41.     TAN()               tangent
  42.     ATN()               arctangent
  43.     LN()                natural log
  44.     LOG()               log base 10
  45.     FACT()              factorial
  46.     EXP()               e raised to the power x
  47.     PI                  the value of PI
  48.     TRUE                the value 1 or boolean true
  49.     FALSE               the value 0 or boolean false
  50.  
  51. The circle functions (SIN COS TAN ATN) all work in radians, not
  52. degrees, so that SIN(PI) = 0, but SIN(90) = 0.893996663600558
  53.  
  54. You can use these operators in any order in any combination for almost
  55. any calculation. Equations are limited in length to the width of the
  56. screen. Each function can have an arbitrarily complicated equation
  57. within its brackets.
  58.  
  59. For example
  60.  
  61.       SQRT(SQR(34.5))
  62.       LOG(FACT(5)+SIN(21)*LN(1.02345296368))
  63.  
  64. You can use scientific notation to enter a long number. For example
  65. 1.23e15 represents the number 1230000000000000.000. Answers have a
  66. maximum precision of 19 digits. If the answer is longer, Word Fugue
  67. will give the closest answer it can, using 20 digits. The largest
  68. number you can work with is 1.1E+4932, and the smallest is 3.4E-4932.
  69. Overflow will cause erroneous results to display. (Word Fugue uses 20
  70. digit reals internally)
  71.  
  72. Where there is more than one operator on a line, Word Fugue performs
  73. the operations in a specific order - exponentiation, then
  74. multiplication, division, then addition and subtraction. When
  75. operators are of equal precedence, Word Fugue performs the operations
  76. from left to right.
  77.  
  78. .CP5
  79. You can change the order in which Word Fugue performs operations by
  80. using parentheses to enclose operations that are to be done first. You
  81. can enclose parentheses within parentheses for more complicated
  82. calculations. Word Fugue always performs the operations within the
  83. innermost set of parentheses first.
  84.  
  85. For example:
  86.   2^3+4-5/6*7           (answer     6.16666667)
  87.   2^(3+4-5)/6*7         (answer     4.66666667)
  88.   2^((3+4-5)/6*7)       (answer     5.03968420)
  89.  
  90. You can also enter boolean equations for evaluation, using the
  91. functions TRUE and FALSE. The boolean operators supported are
  92.  
  93.         AND
  94.         OR
  95.         XOR
  96.         NOT
  97.  
  98. and you can put boolean equations in brackets. The result will be 1
  99. for True and 0 for False.
  100.  
  101. For example
  102.    true xor false               (answer 1.0 boolean)
  103.    1 xor 3                      (answer 2.0 numeric)
  104.    10 / 3                       (answer 3.333333333333333)
  105.    10 div 3                     (answer 3)
  106.    10 mod 3                     (answer 1 (the remainder) )
  107.    5 shl 1                      (answer 10)
  108.    5 shr 1                      (answer 2)
  109.  
  110. NOTE - When you use operators that are letters, you must separate them
  111.        from the values they operate on by spaces. Thus
  112.            10 mod 3 is right but 10mod3 is wrong.
  113.  
  114. .cp8
  115. .tc    Using The Pop Up Calculator ........................#
  116. Using The Pop Up Calculator
  117.  
  118. 1. Press Alt = or Ctrl J M to display the calculator window.
  119. 2. Type an equation.
  120. 3. Press Enter
  121.    You will see the result appear in the next line
  122. 4. Press ESC to return to editing, or press Enter to type in a new
  123.    equation. If you press an editing key first, you can edit the
  124.    existing equation.
  125.  
  126. .tc    Copying the Last Result Into the Document ..........#
  127. Copying the Last Result Into the Document
  128.  
  129. To copy the last result into the document you are editing press 
  130.  
  131.         Alt O =
  132.      or Ctrl J I =
  133.      or Alt M A     (macro)
  134.  
  135. The result will appear where the cursor is positioned.
  136.  
  137. Note the next time you use the calculator in the same editing session,
  138. you will find the last equation displayed ready for you to reenter or
  139. edit.
  140.  
  141. .tc    Copying the Equation into the Document .............#
  142. Copying the Equation into the Document
  143.  
  144. To copy the actual equation used into the document you are editing,
  145. type in
  146.  
  147.         Alt O #
  148.      or Ctrl J I #
  149.      or Alt M E   (macro)
  150.  
  151. The equation will appear at the cursor position.
  152.  
  153.